package punto;

public class PointIIIQ {

    private int x;
    private int y;

    public PointIIIQ() {
        this.x = 0;
        this.y = 0;
    }

    public PointIIIQ(int pX, int pY) {
        this.setX(pX);
        this.setY(pY);
    }

    public PointIIIQ(int pXY) {
        this.setX(pXY);
        this.setY(pXY);
    }

    public boolean setX(int pX) {
        if (pX <= 0) {
            this.x = pX;
            return true;
        }
        return false;
    }

    public boolean setY(int pY) {
        if (pY <= 0) {
            this.y = pY;
            return true;
        }
        return false;
    }

    public int getX() {
        return this.x;
    }

    public int getY() {
        return this.y;
    }

    @Override
    public String toString() {
        return this.x + " " + this.y;
    }

    @Override
    public boolean equals(Object t) {
        if (t instanceof PointIIIQ) {
            PointIIIQ tt = (PointIIIQ) t;
            return tt.x == this.x && tt.y == this.y;
        }
        return false;
    }
}
